-
Notifications
You must be signed in to change notification settings - Fork 23k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REF] account: Add test for issue#30972 #31480
[REF] account: Add test for issue#30972 #31480
Conversation
Unittest for case #30972 |
@hbto @luistorresm |
Test must be done for both Supplier Invoices & Customer Invoices, I can see that the test is done for one of them only and this piece of code is suspicious
because it is considering only one side for the invoices (debit_moves) |
118ec43
to
75d9ec8
Compare
@hbto Added the test for Customer Invoices. Regards. |
75d9ec8
to
9027c9f
Compare
@JulioSerna |
@@ -823,7 +823,7 @@ def _reconcile_lines(self, debit_moves, credit_moves, field): | |||
""" | |||
(debit_moves + credit_moves).read([field]) | |||
to_create = [] | |||
cash_basis = debit_moves and debit_moves[0].account_id.internal_type in ('receivable', 'payable') or False | |||
cash_basis = debit_moves and debit_moves[0].account_id.internal_type in ('receivable', 'payable') and not debit_moves[0].invoice_id or False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why only the debit_move and not the credit_move?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it work for both the in_invoice and the out_invoice?
it is quite weird for me.
Regards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being honest, I don't really know why the debit_moves and not the credit_moves, I only did the change based on the previous criteria for creating a cash basis move (debit_moves) and works for both cases, in and out invoices.
Other than that comment I am ok with this PR |
…ice account.move when the tax cash basis account has set reconcile True. [REF] account: Not create cash basis move when reversing an invoice
9027c9f
to
35f2e50
Compare
👍 given the explanation of @keylor2906 and based on the fact that this commit has the regarding unit tests that support it, I agree on this PR. Regards |
LGTM 👍 |
@moylop260
Your fix is smart, but I'm afraid it will work only for invoice moves and not for any random move |
coming to this through codetriage.com. @moylop260 any answer or can this be closed? |
@hbto |
Yes @moylop260 this is still valid. Regards |
Dear @keylor2906, Thank you for your contribution but the version 12.0 is no longer supported. We apology if we could not look at your request in time. This is an automated message. |
Description of the issue/feature this PR addresses:
Avoid the creation of a cash basis entry when reversing an invoice journal entry.
Steps to reproduce:
Previous configurations:
Current behavior before PR:
A cash basis journal entry is created when reversing the invoice journal entry.
And an error message
You are trying to reconcile some entries that are already reconciled
. is returned when trying to generate the reversal.Desired behavior after PR is merged:
Not create cash basis journal entry when reversing the invoice journal entry. The cash basis entries should be only created on payments. And not getting error message when trying to generate the reversal.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr